home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
IDLIncludes
/
AdminMessagePort.idl
< prev
next >
Wrap
Text File
|
1996-05-01
|
3KB
|
117 lines
/*
File: AdminMessagePort.idl
Contains: xxx put contents here xxx
Version: Technology: xxx put the technology version here xxx
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __ADMINMESSAGEPORT_IDL__
#define __ADMINMESSAGEPORT_IDL__
#include <somobj.idl>
#include <somcls.idl>
#ifndef __TYPES_IDL__
#include <Types.idl>
#endif
#ifdef __SOMIDL__
#if FOR_SYSTEM8_PREEMPTIVE
/*
//------------------------------------------------------------------------------------
The I/O system reserves one bit of the Kernel message system's type mask to use
for administration messages. Different services within the I/O system use this
single message type. The routine and constants described in this file are used
by clients of these administration services to distinguish between the different
types.
It is intended that clients of I/O administration services use a single Kernel
message port (PortID) for all messages: administration and data. Clients can
create multiple message objects (ObjectID) for the same port and pass a different
object to each administration service and use another for data handling.
The client should use separate tasks to receive administration messages and data
messages. Use the message type parameter of ReceiveMessage as a bit-mask to specify
the type of message to receive in each task. The code below shows an example of an
administration task.
AdministrationTask()
{
MessageControlBlock mcb;
union {
DevNMessage devn;
PMMessage pm;
Arbitration arb;
} adminBuffer;
UInt32 messageType;
while (true)
{
ReceiveMessageSync(adminPort, kAMPMessageTypeMask, &mcb, &adminBuffer, ...)
AMPGetMessageType(mcb->messageContents, &messageType);
switch (messageType)
{
case kAMPDeviceNotificationMsg:
{
DevNMessage* devn = mcb.messageContents;
switch (devn->subMessageType)
{
...
}
}
break;
case kAMPPowerManagementMsg:
{
PMMessage* pm = mcb.messageContents;
switch (pm->type)
{
...
}
}
break;
case kAMPArbitrationServiceMsg:
{
Arbitration* arb = mcb.messageContents;
switch (arb->type)
{
...
}
}
break;
default:
break;
}
}
}
//------------------------------------------------------------------------------------
*/
/* Constants for use in ReceiveMessage.*/
/* Constants returned by AMPGetMessageType*/
/*
AMPGetMessageType:
Given an I/O administration message this routine determines the type of
message. If the type cannot be deteremined zero is returned and debugging
builds throw an assertion.
*/
#endif
#endif /* __SOMIDL__ */
#endif /* __ADMINMESSAGEPORT_IDL__ */